This repository was archived by the owner on Apr 28, 2026. It is now read-only.
Test case for nested virtualization #189
Merged
Merged
Conversation
bd6d3b4 to
a645342
Compare
a645342 to
dd9b787
Compare
phip1611
reviewed
Apr 10, 2026
In order to test nested virtualization in different contexts (live migration and with CPU profiles) we add some helper methods to easily spawn a nested CHV Cirros guest. Signed-off-by: Stefan Kober <stefan.kober@cyberus-technology.de> On-behalf-of: SAP stefan.kober@sap.com
bfc28ff to
a033a60
Compare
phip1611
approved these changes
Apr 14, 2026
phip1611
left a comment
Member
There was a problem hiding this comment.
Great work! Please clean up the addition of several packages. Further: Why do we use cirros for the nested VM and not a NixOS-based image?
olivereanderson
approved these changes
Apr 14, 2026
olivereanderson
left a comment
Contributor
There was a problem hiding this comment.
Awesome test. Thanks!
Collaborator
Author
The cirros image is small enough so we do not need to configure any additional disk space for the top-level CHV VM. I thought that makes things simpler. Not sure if it was the right decision though :D |
In order to boot nested guests we need a disk image and a firmware blob inside of our nixos image. Signed-off-by: Stefan Kober <stefan.kober@cyberus-technology.de> On-behalf-of: SAP stefan.kober@sap.com
In order to setup and use networking for the nested guest (TUN, DHCP, SSH) we need to add some packages to the nixos image. Signed-off-by: Stefan Kober <stefan.kober@cyberus-technology.de> On-behalf-of: SAP stefan.kober@sap.com
Utilize the helper functions for nested guests to create a simple live boot test that spawns a nested guest, boots and checks for the nested guest being alive via network. Signed-off-by: Stefan Kober <stefan.kober@cyberus-technology.de> On-behalf-of: SAP stefan.kober@sap.com
Signed-off-by: Stefan Kober <stefan.kober@cyberus-technology.de> On-behalf-of: SAP stefan.kober@sap.com
We test that running a nested guest works when having some active CPU profile. Signed-off-by: Stefan Kober <stefan.kober@cyberus-technology.de> On-behalf-of: SAP stefan.kober@sap.com
Signed-off-by: Stefan Kober <stefan.kober@cyberus-technology.de> On-behalf-of: SAP stefan.kober@sap.com
a033a60 to
c688075
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add tests for nested virtualization with and without using CPU profiles.
Originally, I wanted to add live migration to the test and check if the nested VM is still reachable after migration. But there is following nested virtualization bug that prevents us from doing so: https://github.com/cobaltcore-dev/cobaltcore/issues/489. Therefore, this test is just very simple. If we fix the nesting bug (KVM bug most likely), we can extend the nesting test case.
Update: I also tested the cpu profiles host testsuite on our ferona sapphire rapids box and it works as expected.
Libvirt pipeline: https://gitlab.cyberus-technology.de/cyberus/cloud/libvirt/-/merge_requests/156